//
//  StoreFocusSectionHeader.m
//  BaseProject
//
//  Created by 王洋 on 2020/8/6.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "StoreFocusSectionHeader.h"

@implementation StoreFocusSectionHeader

- (void)fillHeaderWithModel:(CommonSellerModule *)model {
    
    NSString *url = [TT_OSSManager reSourceUrl:model.logoUrl type:BA_resizeType_plus];
    [self.storeIcon sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.storeName.text = model.sellerName;
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.storeIcon pp_clipCorners:UIRectCornerAllCorners radius:3];
    });
}

- (IBAction)focusAction:(id)sender {
    if (self.StoreFocusSectionHeaderBlock) {
        self.StoreFocusSectionHeaderBlock();
    }
}

@end
